const path = require('path')
let stylePath = path.resolve(__dirname, 'common/style/global.less') 
const CopyWebpackPlugin = require('copy-webpack-plugin') //最新版本copy-webpack-plugin插件暂不兼容，推荐v5.0.0

module.exports = {
	configureWebpack: {
		plugins: [
			new CopyWebpackPlugin([
				{
					from: path.join(__dirname, 'douyin.package.json'),
					to: path.join(__dirname, `unpackage/dist/${process.env.NODE_ENV === 'production' ? 'build' : 'dev'}/mp-toutiao/package.json`)
				}
			])
		]
	},
	css: {
			loaderOptions: {
				less: {
					globalVars: {
						"hack": `true; @import "${stylePath}"`
					}
				}
			}
		},

}